home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 …ember: Reference Library / Dev.CD Dec 98 RL1.toast / What's New / Development Kits / AppleShare IP 6.1 SDK / ASIP Server Controls⁄Events / Headers / AppleShareFileServerControl.p < prev   
Encoding:
Text File  |  1998-10-26  |  29.6 KB  |  938 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        AppleShareFileServerControl.p
  3.  
  4.      Contains:    Interface definitions for Server Control calls, and Server Event constants;
  5.  
  6.      Version:    Technology:    AppleShare IP 6.0
  7.                  Release:    ASIP 6.1 SDK - Wednesday, September 16, 1998 1:48:54 PM
  8.  
  9.      Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. }
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT AppleShareFileServerControl;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __APPLESHAREFILESERVERCONTROL__}
  27. {$SETC __APPLESHAREFILESERVERCONTROL__ := 1}
  28.  
  29. {$I+}
  30. {$SETC AppleShareFileServerControlIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33. {$IFC UNDEFINED __APPLETALK__}
  34. {$I AppleTalk.p}
  35. {$ENDC}
  36. {$IFC UNDEFINED __MIXEDMODE__}
  37. {$I MixedMode.p}
  38. {$ENDC}
  39. {$IFC UNDEFINED __FILES__}
  40. {$I Files.p}
  41. {$ENDC}
  42.  
  43.  
  44. {$PUSH}
  45. {$ALIGN MAC68K}
  46. {$LibExport+}
  47.  
  48. {  Server Control Codes ----------------------------------------------------------------------------  }
  49.  
  50. CONST
  51.     kSCStartServer                = 0;                            {  Use StartParam variant  }
  52.     kSCShutDown                    = 2;                            {  Use DisconnectParam variant  }
  53.     kSCCancelShutDown            = 3;                            {  Use DisconnectParam variant  }
  54.     kSCDisconnect                = 4;                            {  Use DisconnectParam variant  }
  55.     kSCPollServer                = 5;                            {  Use PollServerParam variant  }
  56.     kSCGetExpFldr                = 6;                            {  Use StandardParam variant  }
  57.     kSCGetSetupInfo                = 7;                            {  Use SetupParam variant  }
  58.     kSCSetSetupInfo                = 8;                            {  Use SetupParam variant  }
  59.     kSCSendMessage                = 9;                            {  Use DisconnectParam variant  }
  60.     kSCGetServerStatus            = 10;                            {  Use StatusParam variant  }
  61.     kSCInstallServerEventProc    = 11;                            {  Use ServerEventParam variant  }
  62.     kSCRemoveServerEventProc    = 12;                            {  Use ServerEventParam variant  }
  63.     kSCGetServerEventProc        = 13;                            {  Use ServerEventParam variant  }
  64.     kSCServerVersion            = 14;                            {  Use VersionParam variant  }
  65.     kSCSetCopyProtect            = 16;                            {  Use StandardParam variant  }
  66.     kSCClrCopyProtect            = 17;                            {  Use StandardParam variant  }
  67.     kSCDisconnectVolUsers        = 18;                            {  Use DisconnectParam variant  }
  68.     kSCGetUserNameRec            = 19;                            {  Use UserInfoParam variant  }
  69.     kSCGetUserMountInfo            = 20;                            {  Use VolMountedParam variant  }
  70.     kSCWakeServer                = 21;                            {  Use StartParam variant  }
  71.     kSCSleepServer                = 22;                            {  Use DisconnectParam variant  }
  72.     kSCGetCacheStats            = 23;                            {  Use GetCacheStatsParam variant  }
  73.     kSCResetCache                = 31;                            {  Use ResetCacheParam variant  }
  74.     kSCGetExtUserNameRec        = 35;                            {  Use ExtUserInfoParam variant  }
  75.     kSCServiceStateInfo            = 38;                            {  Use ServiceStateParam variant  }
  76.     kSCGetPlugInInfo            = 41;                            {  Use PlugInInfoParam variant  }
  77.     kSCGetPlugInMimeType        = 42;                            {  Use PlugInMimeTypeParam variant  }
  78.     kSCSetHistorySampleTime        = 43;                            {  Use SetHistoryParam variant  }
  79.     kSCGetServerActivityHistory    = 44;                            {  Use GetHistoryParam variant  }
  80.  
  81. {  General Constants -------------------------------------------------------------------------------  }
  82. {  PollServer scServerState responses...  }
  83.     kSCPollRunning                = -1;
  84.     kSCPollStartingUp            = -2;
  85.     kSCPollJustDisabled            = -3;
  86.     kSCPollDisabledErr            = -4;
  87.     kSCPollSleeping                = -5;
  88.  
  89. {  PollServer scDisconnectState responses...  }
  90.     kSCNotDisconnecting            = -1;
  91.     kSCDisconnectWithin29Secs    = 0;
  92.     kSCDisconnect30To89Secs        = 1;                            {  Any other value is the number of minutes remaining, rounded...  }
  93.  
  94. {  PollServer scServerErrors responses...  }
  95.     kSCModernMemMgrOffErr        = 1;                            {  Must run with Modern Memory Manager  }
  96.     kSCNoThreadLibraryErr        = 2;
  97.     kSCServiceNotInstalledErr    = 3;
  98.     kSCInsuffMFMemErr            = 4;
  99.     kSCCantRegNameErr            = 5;
  100.     kSCCantFindExtnFolderErr    = 6;
  101.     kSCUnExATalkErr                = 7;
  102.     kSCNoMachineNameErr            = 8;
  103.     kSCCantFindFSExtnErr        = 9;
  104.     kSCATalkOffErr                = 10;
  105.     kSCNoInitRunErr                = 12;
  106.     kSCInsuffAppMemErr            = 14;
  107.     kSCBadConfigErr                = 15;
  108.     kSCNoDTOnStartupErr            = 16;
  109.     kSCDupNameErr                = 17;
  110.     kSCBadFileBufParmsErr        = 19;
  111.     kSCNeedRootUserErr            = 20;                            {  The range 21-28 are reserved for future use by Apple.  }
  112.     kSCBadSerialNumErr            = 29;
  113.     kSCSysTooOldErr                = 34;
  114.     kSCDupSerialNumberErr        = 36;                            {  NBP dup serial number detected  }
  115.     kSCVMOnErr                    = 37;                            {  Virtual Memory is turned on on server machine  }
  116.     kSCNoPPCErr                    = 38;                            {  Server only runs on a ppc machine  }
  117.     kSCBadInitErr                = 39;
  118.     kSCOpenTransportInstallErr    = 40;                            {  Incompatible version of Open Transport  }
  119.     kSCNoAgentLibErr            = 41;                            {  No ASRLib  }
  120.     kSCNoAgentSessionErr        = 42;                            {  Could not open an agent session  }
  121.     kSCInvalidAgentErr            = 43;                            {  No agent or a problem with the agent  }
  122.     kSCAgentServerObjErr        = 44;                            {  Bad server object type.  }
  123.     kSCAgentGenesisErr            = 46;
  124.     kSCAlreadyShuttingDown        = -1;
  125.     kSCAlreadyDisconnecting        = -2;
  126.     kSCDeletedPDSErr            = -2;
  127.     kSCContainsExpFolderErr        = -3;
  128.     kSCCantPrepareVolumeErr        = -4;
  129.     kSCTooManyExpFoldersErr        = -5;
  130.     kSCFixedPDSErr                = -6;
  131.     kSCExpFolderNamConfErr        = -7;
  132.     kSCNoExportFolderErr        = -8;
  133.     kSCInsideExpFolderErr        = -9;
  134.     kSCInsideTrashErr            = -10;
  135.     kSCVolNameConflictErr        = -11;
  136.     kSCCacheReducedErr            = -12;
  137.     kSCBadIPConfigErr            = -20;
  138.     kSCBadAccessPrivRecErr        = -21;
  139.     kSCBadMimeTypeFileErr        = -22;
  140.     kSCDuplicateVolumeErr        = -23;                            {  Second volume with same name will not be shared  }
  141.                                                                 {  -100 to -199 are AFP errors  }
  142.     kSCAFPGenErr                = -100;
  143.     kSCAFPTCPGenErr                = -150;
  144.     kSCAFPTCPMemErr                = -151;
  145.     kSCAFPTCPPortInUseErr        = -152;                            {  -200 to -299 are FTP errors  }
  146.     kSCFTPGenErr                = -200;
  147.     kSCFTPPortInUseErr            = -201;
  148.     kSCFTPNotAvailErr            = -202;
  149.     kSCFTPMemErr                = -203;                            {  -300 to -399 are Web errors  }
  150.     kSCHTTPGenErr                = -300;
  151.     kSCHTTPPortInUseErr            = -302;
  152.     kSCHTTPFolderErr            = -303;
  153.     kSCHTTPFileErr                = -304;
  154.     kSCHTTPMemErr                = -305;
  155.     kSCHTTPNoMimeTypesErr        = -306;
  156.     kSCHTTPNoDefaultMimeErr        = -307;
  157.     kSCPluginDirNotFoundErr        = -308;
  158.     kSCPluginMemFullErr            = -309;
  159.     kSCPluginPreProcNotFoundErr    = -310;
  160.     kSCPluginPostProcNotFoundErr = -311;
  161.     kSCErrorPluginNotFoundErr    = -312;
  162.     kSCPluginNotPreProcessorErr    = -313;
  163.     kSCPluginNotPostProcessorErr = -314;
  164.     kSCPluginMemPoolFullErr        = -315;
  165.     kSCPluginOutOfMemoryErr        = -316;
  166.     kSCCorruptedMimeTypesErr    = -317;
  167.     kSCPlugInLoggingErr            = -318;
  168.     kSCPlugInTypeConflictErr    = -319;
  169.     kSCPlugInCannotRegisterErr    = -320;
  170.     kSCPlugInMemSmallErr        = -321;
  171.     kSCWebAdminNetworkErr        = -330;                            {  -400 to -499 are SMB errors   }
  172.     kSCSMBGenErr                = -400;
  173.     kSCSMBPortInUseErr            = -402;
  174.     kSCSMBMemErr                = -405;
  175.  
  176. {  Define Maximum amount of time for shutdown...  }
  177.     kSCMaxTimer                    = 4094;
  178.  
  179. {  Plugin errors (PlugInMimeTypeParam, PlugInInfoParam)...  }
  180.     kSCPlugInNoErr                = 0;
  181.     kSCPlugInWrongVersionErr    = 1;
  182.     kSCPlugInBadIndexErr        = 2;
  183.     kSCPlugInPlugInsNotLoadedErr = 3;
  184.     kSCPlugInBadPlugInRefErr    = 4;
  185.  
  186. {  Plugin info dimensions (C-strings)...  }
  187.     kSCPlugInNameSize            = 32;
  188.     kSCPlugInAdminURLSize        = 256;
  189.     kSCPlugInVersionStrSize        = 12;
  190.     kSCMimeTypeSize                = 80;
  191.     kSCSuffixSize                = 32;
  192.  
  193. {  Number of samples in ServerHistoryRec...  }
  194.     kMaxDataPoints                = 1024;
  195.  
  196. {  For siVersion field of SetupInfoRec... }
  197.     kSCSetUpRecordVersion        = 3;
  198.  
  199. {  VersionParam's scServerType contains the server type, which is interpreted as follows:  }
  200.     kSCMFSServerType            = $0000;                        {  Macintosh File Sharing  }
  201.     kSCAFSServerType            = $0001;                        {  AppleShare/AppleShare IP File Server  }
  202.  
  203. {$IFC UNDEFINED SCCACHESTATSRECVERS3 }
  204. {$SETC SCCACHESTATSRECVERS3 := 1 }
  205. {  For csVersion field of SCCacheStatsRec...  }
  206.     kSCCacheStatsRecVersion        = 3;
  207.  
  208. {$ENDC}
  209.  
  210. {  Current version number of scFileInfoRec block...  }
  211.     kSCFileInfoRecVersion        = 1;
  212.  
  213. {  Parameters for the "bitmap" field of ResetCacheParam...  }
  214.     kSCResetFileCache            = $0001;
  215.     kSCResetCNodeCache            = $0002;
  216.     kSCResetDTCache                = $0004;
  217.     kSCShrinkCache                = $8000;
  218.     kSCShrinkAllCaches            = $8007;
  219.  
  220. {  For attrVersion field of ExtUserInfoParam...  }
  221.     kSCOldUserAttrRecVersion    = 0;
  222.     kSCUserAttrRecVersion        = 1;
  223.  
  224. {  Current session layers for scProtocolType field of UserAttrRec...  }
  225.     kSCSessionInvalid            = $0000;
  226.     kSCSessionAll                = 'alls';
  227.     kSCSessionAFP                = 'afp ';
  228.     kSCSessionHTTP                = 'http';
  229.     kSCSessionFTP                = 'ftp ';
  230.     kSCSessionSMB                = 'smb ';
  231.     kSCSessionNFS                = 'nfs ';
  232.  
  233. {  Current transport layers for scTransportType field of UserAttrRec...  }
  234.     kSCTransportATP                = 'atp ';
  235.     kSCTransportTCP                = 'tcp ';
  236.  
  237. {  For version field of PlugInInfoParam...  }
  238.     kSCPlugInInfoParamVersion    = 0;
  239.  
  240. {  For plugInAttributes field of PlugInInfoParam...  }
  241.     kSCAttPreProcessor            = $00000001;                    {  works as a preprocessor  }
  242.     kSCAttPostProcessor            = $00000002;                    {  works as a postprocessor  }
  243.     kSCAttFilter                = $00000004;                    {  works as filter  }
  244.     kSCAttAccessControl            = $00000008;                    {  works as access control  }
  245.     kSCAttErrorProcessor        = $00000010;                    {  works as error processor  }
  246.  
  247. {  Current version number of SCSrvrMsgsRec...  }
  248.     kSCSrvrMsgsRecVersion        = 1;
  249.  
  250. {  For version field of PlugInMimeTypeParam...  }
  251.     kSCPlugInMimeTypeParamVersion = 0;
  252.  
  253. {  Misc params... }
  254.     kSCCurrentlyInstalled        = 0;
  255.     kSCUseFinderExtension        = 0;
  256.     kSCStartingEntity            = 1;
  257.     kSCStartingExtension        = 2;
  258.     kSCUseMessagePtr            = 1;
  259.  
  260. {  Server Control Data Structures ------------------------------------------------------------------  }
  261.  
  262. {
  263.    Since all calls are made through ServerDispatchSync, ioCompletion is ignored, so this is for
  264.    completeness only..., 
  265. }
  266.  
  267. TYPE
  268.     SCCompletionUPP                        = UniversalProcPtr;
  269.     StartParamPtr = ^StartParam;
  270.     StartParam = RECORD
  271.         qLink:                    QElemPtr;                                { queue link in header }
  272.         qType:                    SInt16;                                    { type byte for safety check }
  273.         ioTrap:                    SInt16;                                    { FS: the Trap }
  274.         ioCmdAddr:                Ptr;                                    { FS: address to dispatch to }
  275.         ioCompletion:            SCCompletionUPP;                        { completion routine addr (0 for synch calls) }
  276.         ioResult:                OSErr;                                    { result code }
  277.         reserved:                SInt32;
  278.         reserved2:                SInt16;
  279.         reserved3:                SInt16;
  280.         scCode:                    SInt16;
  281.         scStartSelect:            SInt16;
  282.         scEventSelect:            SInt16;
  283.         scWhere:                SInt32;
  284.         scReceiverID:            SInt32;
  285.         scDataType:                SInt32;
  286.         scStartOptions:            SInt32;
  287.     END;
  288.  
  289.     DisconnectParamPtr = ^DisconnectParam;
  290.     DisconnectParam = RECORD
  291.         qLink:                    QElemPtr;                                { queue link in header }
  292.         qType:                    SInt16;                                    { type byte for safety check }
  293.         ioTrap:                    SInt16;                                    { FS: the Trap }
  294.         ioCmdAddr:                Ptr;                                    { FS: address to dispatch to }
  295.         ioCompletion:            SCCompletionUPP;                        { completion routine addr (0 for synch calls) }
  296.         ioResult:                OSErr;                                    { result code }
  297.         scDiscArrayPtr:            LongIntPtr;
  298.         scArrayCount:            SInt16;
  299.         reserved:                SInt16;
  300.         scCode:                    SInt16;
  301.         scNumMinutes:            SInt16;
  302.         scFlags:                SInt16;
  303.         scMessagePtr:            StringPtr;
  304.     END;
  305.  
  306.     PollServerParamPtr = ^PollServerParam;
  307.     PollServerParam = RECORD
  308.         qLink:                    QElemPtr;                                { queue link in header }
  309.         qType:                    SInt16;                                    { type byte for safety check }
  310.         ioTrap:                    SInt16;                                    { FS: the Trap }
  311.         ioCmdAddr:                Ptr;                                    { FS: address to dispatch to }
  312.         ioCompletion:            SCCompletionUPP;                        { completion routine addr (0 for synch calls) }
  313.         ioResult:                OSErr;                                    { result code }
  314.         reserved:                SInt32;
  315.         reserved2:                SInt16;
  316.         reserved3:                SInt16;
  317.         scCode:                    SInt16;
  318.         scServerState:            SInt16;
  319.         scDisconnectState:        SInt16;
  320.         scServerError:            SInt16;
  321.         scSecondsLeft:            SInt32;
  322.     END;
  323.  
  324.     StandardParamPtr = ^StandardParam;
  325.     StandardParam = RECORD
  326.         qLink:                    QElemPtr;                                { queue link in header }
  327.         qType:                    SInt16;                                    { type byte for safety check }
  328.         ioTrap:                    SInt16;                                    { FS: the Trap }
  329.         ioCmdAddr:                Ptr;                                    { FS: address to dispatch to }
  330.         ioCompletion:            SCCompletionUPP;                        { completion routine addr (0 for synch calls) }
  331.         ioResult:                OSErr;                                    { result code }
  332.         scNamePtr:                StringPtr;
  333.         scVRefNum:                SInt16;
  334.         scLogins:                SInt16;
  335.         scCode:                    SInt16;
  336.         scIndex:                SInt16;
  337.         scDirID:                SInt32;
  338.     END;
  339.  
  340.     Str198                                = STRING[198];
  341.     SetupInfoRecPtr = ^SetupInfoRec;
  342.     SetupInfoRec = RECORD
  343.         siVersion:                SInt16;
  344.         siFlags:                SInt16;
  345.         siMaxLogins:            SInt16;
  346.         siSrvrUsageLimit:        SInt16;
  347.         siVolInfoLocation:        Point;
  348.         siVolInfoVisible:        BOOLEAN;
  349.         siReserved1:            BOOLEAN;
  350.         siUserInfoLocation:        Point;
  351.         siUserInfoVisible:        BOOLEAN;
  352.         siReserved2:            BOOLEAN;
  353.         siShutDownMins:            SInt16;
  354.         siCacheControl:            SInt16;                                    {  no longer used  }
  355.         siVolParmsStepSize:        SInt16;
  356.         siVolParmsIncrement:    SInt16;
  357.         siVolParmsFirstDelay:    SInt16;
  358.         siVolParmsMaxDelay:        SInt16;
  359.         siRACacheFileBufSize:    SInt32;                                    {  no longer used  }
  360.         siRACacheSize:            SInt32;                                    {  no longer used  }
  361.         siDirCacheMaxWidth:        SInt16;                                    {  no longer used  }
  362.         siDirCacheSize:            SInt32;                                    {  no longer used  }
  363.         siIconCacheSize:        SInt32;                                    {  no longer used  }
  364.         siBTMemReservedFromCache: SInt32;
  365.         siSpare:                ARRAY [0..0] OF SInt16;                    {  reserved  }
  366.         siLoginMsg:                Str198;
  367.     END;
  368.  
  369.     SetupInfoPtr                        = ^SetupInfoRec;
  370.     SetupParamPtr = ^SetupParam;
  371.     SetupParam = RECORD
  372.         qLink:                    QElemPtr;                                { queue link in header }
  373.         qType:                    SInt16;                                    { type byte for safety check }
  374.         ioTrap:                    SInt16;                                    { FS: the Trap }
  375.         ioCmdAddr:                Ptr;                                    { FS: address to dispatch to }
  376.         ioCompletion:            SCCompletionUPP;                        { completion routine addr (0 for synch calls) }
  377.         ioResult:                OSErr;                                    { result code }
  378.         scSetupPtr:                SetupInfoPtr;
  379.         scMaxVolumes:            SInt16;
  380.         scMaxExpFolders:        SInt16;
  381.         scCode:                    SInt16;
  382.         scCurMaxSessions:        SInt16;
  383.     END;
  384.  
  385.     StatusParamPtr = ^StatusParam;
  386.     StatusParam = RECORD
  387.         qLink:                    QElemPtr;                                { queue link in header }
  388.         qType:                    SInt16;                                    { type byte for safety check }
  389.         ioTrap:                    SInt16;                                    { FS: the Trap }
  390.         ioCmdAddr:                Ptr;                                    { FS: address to dispatch to }
  391.         ioCompletion:            SCCompletionUPP;                        { completion routine addr (0 for synch calls) }
  392.         ioResult:                OSErr;                                    { result code }
  393.         scNamePtr:                StringPtr;
  394.         reserved2:                SInt16;
  395.         reserved3:                SInt16;
  396.         scCode:                    SInt16;
  397.         scServerFlags:            SInt16;
  398.         scNumSessions:            SInt16;
  399.         scUserListModDate:        SInt32;
  400.         scActivity:                SInt16;
  401.         scVolListModDate:        SInt32;
  402.     END;
  403.  
  404.     ServerEventParamPtr = ^ServerEventParam;
  405.     ServerEventParam = RECORD
  406.         qLink:                    QElemPtr;                                { queue link in header }
  407.         qType:                    SInt16;                                    { type byte for safety check }
  408.         ioTrap:                    SInt16;                                    { FS: the Trap }
  409.         ioCmdAddr:                Ptr;                                    { FS: address to dispatch to }
  410.         ioCompletion:            SCCompletionUPP;                        { completion routine addr (0 for synch calls) }
  411.         ioResult:                OSErr;                                    { result code }
  412.         scSEQEntryPtr:            Ptr;
  413.         reserved2:                SInt16;
  414.         reserved3:                SInt16;
  415.         scCode:                    SInt16;
  416.     END;
  417.  
  418.     VersionParamPtr = ^VersionParam;
  419.     VersionParam = RECORD
  420.         qLink:                    QElemPtr;                                { queue link in header }
  421.         qType:                    SInt16;                                    { type byte for safety check }
  422.         ioTrap:                    SInt16;                                    { FS: the Trap }
  423.         ioCmdAddr:                Ptr;                                    { FS: address to dispatch to }
  424.         ioCompletion:            SCCompletionUPP;                        { completion routine addr (0 for synch calls) }
  425.         ioResult:                OSErr;                                    { result code }
  426.         scExtNamePtr:            StringPtr;
  427.         reserved2:                SInt16;
  428.         reserved3:                SInt16;
  429.         scCode:                    SInt16;
  430.         scServerType:            SInt16;
  431.         scServerVersion:        SInt16;
  432.     END;
  433.  
  434.     UserInfoParamPtr = ^UserInfoParam;
  435.     UserInfoParam = RECORD
  436.         qLink:                    QElemPtr;                                { queue link in header }
  437.         qType:                    SInt16;                                    { type byte for safety check }
  438.         ioTrap:                    SInt16;                                    { FS: the Trap }
  439.         ioCmdAddr:                Ptr;                                    { FS: address to dispatch to }
  440.         ioCompletion:            SCCompletionUPP;                        { completion routine addr (0 for synch calls) }
  441.         ioResult:                OSErr;                                    { result code }
  442.         scNamePtr:                StringPtr;
  443.         reserved2:                SInt16;
  444.         reserved3:                SInt16;
  445.         scCode:                    SInt16;
  446.         scPosition:                SInt32;
  447.         scUNRecID:                SInt32;
  448.         scUserID:                SInt32;
  449.         scLoginTime:            SInt32;
  450.         scLastUseTime:            SInt32;
  451.         scSocketNum:            SInt32;
  452.     END;
  453.  
  454.     VolMountedParamPtr = ^VolMountedParam;
  455.     VolMountedParam = RECORD
  456.         qLink:                    QElemPtr;                                { queue link in header }
  457.         qType:                    SInt16;                                    { type byte for safety check }
  458.         ioTrap:                    SInt16;                                    { FS: the Trap }
  459.         ioCmdAddr:                Ptr;                                    { FS: address to dispatch to }
  460.         ioCompletion:            SCCompletionUPP;                        { completion routine addr (0 for synch calls) }
  461.         ioResult:                OSErr;                                    { result code }
  462.         reserved:                Ptr;
  463.         scVRefNum:                SInt16;
  464.         reserved3:                SInt16;
  465.         scCode:                    SInt16;
  466.         scFilesOpen:            SInt16;
  467.         scWriteableFiles:        SInt16;
  468.         scUNRecID:                SInt32;
  469.         scMounted:                BOOLEAN;
  470.         scMountedAsOwner:        BOOLEAN;
  471.     END;
  472.  
  473.     SCCacheStatsRecPtr = ^SCCacheStatsRec;
  474.     SCCacheStatsRec = RECORD
  475.         csVersion:                SInt16;
  476.         csCacheTime:            SInt32;
  477.         csRACacheAttempts:        SInt32;                                    {  file cache  }
  478.         csRACacheHits:            SInt32;
  479.         csRACacheTotalEntries:    SInt32;
  480.         csRACacheEntriesInUse:    SInt32;
  481.         csRACacheEntrySize:        SInt32;
  482.         csDirCacheAttempts:        SInt32;                                    {  dir cache  }
  483.         csDirCacheHits:            SInt32;
  484.         csDirCacheTotalEntries:    SInt32;
  485.         csDirCacheEntriesInUse:    SInt32;
  486.         csDirCacheEntrySize:    SInt32;
  487.         csIconCacheAttempts:    SInt32;                                    {  dt cache  }
  488.         csIconCacheHits:        SInt32;
  489.         csIconCacheTotalEntries: SInt32;
  490.         csIconCacheEntriesInUse: SInt32;
  491.         csIconCacheEntrySize:    SInt32;
  492.         csACtlCacheAttempts:    SInt32;                                    {  PDS info, part of dir cache  }
  493.         csACtlCacheHits:        SInt32;
  494.         csACtlCacheTotalEntries: SInt32;
  495.         csACtlCacheEntriesInUse: SInt32;
  496.         csACtlCacheEntrySize:    SInt32;
  497.         csAUXCacheAttempts:        SInt32;                                    {  not used  }
  498.         csAUXCacheHits:            SInt32;
  499.         csAUXCacheTotalEntries:    SInt32;
  500.         csAUXCacheEntriesInUse:    SInt32;
  501.         csAUXCacheEntrySize:    SInt32;
  502.                                                                         {   New fields for version 3 record }
  503.         csEnumCacheAttempts:    SInt32;
  504.         csEnumCacheHits:        SInt32;
  505.         csEnumCacheTotalEntries: SInt32;
  506.         csEnumCacheEntriesInUse: SInt32;
  507.         csEnumCacheEntrySize:    SInt32;
  508.         csMaxFBUsed:            SInt32;
  509.         csSkipPrsAttempts:        SInt32;
  510.         csSkipPrsHits:            SInt32;
  511.     END;
  512.  
  513.     SCOldCacheStatsRecPtr = ^SCOldCacheStatsRec;
  514.     SCOldCacheStatsRec = RECORD
  515.         csVersion:                SInt16;
  516.         csCacheTime:            SInt32;
  517.         csRACacheAttempts:        SInt32;                                    {  file cache  }
  518.         csRACacheHits:            SInt32;
  519.         csRACacheTotalEntries:    SInt32;
  520.         csRACacheEntriesInUse:    SInt32;
  521.         csRACacheEntrySize:        SInt32;
  522.         csDirCacheAttempts:        SInt32;                                    {  dir cache  }
  523.         csDirCacheHits:            SInt32;
  524.         csDirCacheTotalEntries:    SInt32;
  525.         csDirCacheEntriesInUse:    SInt32;
  526.         csDirCacheEntrySize:    SInt32;
  527.         csIconCacheAttempts:    SInt32;                                    {  dt cache  }
  528.         csIconCacheHits:        SInt32;
  529.         csIconCacheTotalEntries: SInt32;
  530.         csIconCacheEntriesInUse: SInt32;
  531.         csIconCacheEntrySize:    SInt32;
  532.         csACtlCacheAttempts:    SInt32;                                    {  PDS info, part of dir cache  }
  533.         csACtlCacheHits:        SInt32;
  534.         csACtlCacheTotalEntries: SInt32;
  535.         csACtlCacheEntriesInUse: SInt32;
  536.         csACtlCacheEntrySize:    SInt32;
  537.         csAUXCacheAttempts:        SInt32;                                    {  not used  }
  538.         csAUXCacheHits:            SInt32;
  539.         csAUXCacheTotalEntries:    SInt32;
  540.         csAUXCacheEntriesInUse:    SInt32;
  541.         csAUXCacheEntrySize:    SInt32;
  542.     END;
  543.  
  544.     GetCacheStatsParamPtr = ^GetCacheStatsParam;
  545.     GetCacheStatsParam = RECORD
  546.         qLink:                    QElemPtr;                                { queue link in header }
  547.         qType:                    SInt16;                                    { type byte for safety check }
  548.         ioTrap:                    SInt16;                                    { FS: the Trap }
  549.         ioCmdAddr:                Ptr;                                    { FS: address to dispatch to }
  550.         ioCompletion:            SCCompletionUPP;                        { completion routine addr (0 for synch calls) }
  551.         ioResult:                OSErr;                                    { result code }
  552.         reserved:                Ptr;
  553.         reserved2:                SInt16;
  554.         reserved3:                SInt16;
  555.         scCode:                    SInt16;
  556.         reserved4:                SInt16;
  557.         scCacheStatsPtr:        SCCacheStatsRecPtr;
  558.         scCacheStatsReqSize:    SInt16;
  559.         scCacheStatsActSize:    SInt16;
  560.     END;
  561.  
  562.     ResetCacheParamPtr = ^ResetCacheParam;
  563.     ResetCacheParam = RECORD
  564.         qLink:                    QElemPtr;                                { queue link in header }
  565.         qType:                    SInt16;                                    { type byte for safety check }
  566.         ioTrap:                    SInt16;                                    { FS: the Trap }
  567.         ioCmdAddr:                Ptr;                                    { FS: address to dispatch to }
  568.         ioCompletion:            SCCompletionUPP;                        { completion routine addr (0 for synch calls) }
  569.         ioResult:                OSErr;                                    { result code }
  570.         reserved:                SInt32;
  571.         reserved2:                SInt16;
  572.         reserved3:                SInt16;
  573.         scCode:                    SInt16;
  574.         bitmap:                    SInt16;
  575.     END;
  576.  
  577. {  Used in extended user call if attrVersion is kOldUserAttrRecVersion...  }
  578.     OldUserAttrRecPtr = ^OldUserAttrRec;
  579.     OldUserAttrRec = RECORD
  580.         scLoginTime:            SInt32;
  581.         scLastUseTime:            SInt32;
  582.         scSocketNum:            SInt32;
  583.         scConnectionType:        SInt16;
  584.         scDisconnectID:            SInt16;
  585.     END;
  586.  
  587.     OldUserAttrPtr                        = ^OldUserAttrRec;
  588. {  Used in extended user call if attrVersion is kUserAttrRecVersion...  }
  589.     UserAttrRecPtr = ^UserAttrRec;
  590.     UserAttrRec = RECORD
  591.         scLoginTime:            SInt32;
  592.         scLastUseTime:            SInt32;
  593.         scSocketNum:            SInt32;
  594.         scProtocolType:            FourCharCode;                            {  The Session Protocol, i.e. AFP, FTP, SMB  }
  595.         scTransportType:        FourCharCode;                            {  The Transport, i.e. ATP, TCP/IP  }
  596.         scSessionNamePtr:        StringPtr;                                {  Str63  }
  597.         scDisconnectID:            SInt32;
  598.     END;
  599.  
  600.     UserAttrPtr                            = ^UserAttrRec;
  601.     ExtUserInfoParamPtr = ^ExtUserInfoParam;
  602.     ExtUserInfoParam = RECORD
  603.         qLink:                    QElemPtr;                                { queue link in header }
  604.         qType:                    SInt16;                                    { type byte for safety check }
  605.         ioTrap:                    SInt16;                                    { FS: the Trap }
  606.         ioCmdAddr:                Ptr;                                    { FS: address to dispatch to }
  607.         ioCompletion:            SCCompletionUPP;                        { completion routine addr (0 for synch calls) }
  608.         ioResult:                OSErr;                                    { result code }
  609.         scNamePtr:                StringPtr;
  610.         reserved2:                SInt16;
  611.         reserved3:                SInt16;
  612.         scCode:                    SInt16;
  613.         scPosition:                SInt32;
  614.         scUNRecID:                SInt32;
  615.         scUserID:                SInt32;
  616.         attrVersion:            SInt16;
  617.         scUserAttrPtr:            UserAttrPtr;
  618.     END;
  619.  
  620.     ServiceStateParamPtr = ^ServiceStateParam;
  621.     ServiceStateParam = RECORD
  622.         qLink:                    QElemPtr;                                { queue link in header }
  623.         qType:                    SInt16;                                    { type byte for safety check }
  624.         ioTrap:                    SInt16;                                    { FS: the Trap }
  625.         ioCmdAddr:                Ptr;                                    { FS: address to dispatch to }
  626.         ioCompletion:            SCCompletionUPP;                        { completion routine addr (0 for synch calls) }
  627.         ioResult:                OSErr;                                    { result code }
  628.         reserved:                StringPtr;
  629.         reserved2:                SInt16;
  630.         reserved3:                SInt16;
  631.         scCode:                    SInt16;
  632.         afpTCPState:            SInt16;
  633.         httpState:                SInt16;
  634.         ftpState:                SInt16;
  635.         multiHoming:            SInt16;
  636.         srvrUsageLimit:            SInt16;
  637.     END;
  638.  
  639.     PlugInInfoParamPtr = ^PlugInInfoParam;
  640.     PlugInInfoParam = RECORD
  641.         qLink:                    QElemPtr;                                { queue link in header }
  642.         qType:                    SInt16;                                    { type byte for safety check }
  643.         ioTrap:                    SInt16;                                    { FS: the Trap }
  644.         ioCmdAddr:                Ptr;                                    { FS: address to dispatch to }
  645.         ioCompletion:            SCCompletionUPP;                        { completion routine addr (0 for synch calls) }
  646.         ioResult:                OSErr;                                    { result code }
  647.         reserved:                SInt32;
  648.         reserved2:                SInt16;
  649.         reserved3:                SInt16;
  650.         scCode:                    SInt16;
  651.         version:                SInt16;
  652.         index:                    SInt32;
  653.         error:                    SInt8;
  654.         reserved4:                SInt8;
  655.         name:                    PACKED ARRAY [0..31] OF CHAR;
  656.         versionStr:                PACKED ARRAY [0..11] OF CHAR;
  657.         adminURL:                PACKED ARRAY [0..255] OF CHAR;
  658.         plugInAttributes:        UInt32;
  659.         plugInRef:                SInt32;
  660.         isLast:                    SInt16;
  661.     END;
  662.  
  663.     PlugInMimeTypeParamPtr = ^PlugInMimeTypeParam;
  664.     PlugInMimeTypeParam = RECORD
  665.         qLink:                    QElemPtr;                                { queue link in header }
  666.         qType:                    SInt16;                                    { type byte for safety check }
  667.         ioTrap:                    SInt16;                                    { FS: the Trap }
  668.         ioCmdAddr:                Ptr;                                    { FS: address to dispatch to }
  669.         ioCompletion:            SCCompletionUPP;                        { completion routine addr (0 for synch calls) }
  670.         ioResult:                OSErr;                                    { result code }
  671.         reserved:                SInt32;
  672.         reserved2:                SInt16;
  673.         reserved3:                SInt16;
  674.         scCode:                    SInt16;
  675.         version:                SInt16;
  676.         plugInRef:                SInt32;
  677.         index:                    SInt32;
  678.         error:                    SInt8;
  679.         reserved4:                SInt8;
  680.         mimetype:                PACKED ARRAY [0..79] OF CHAR;
  681.         suffix:                    PACKED ARRAY [0..31] OF CHAR;
  682.         typeCode:                OSType;
  683.         creatorCode:            OSType;
  684.         isLast:                    SInt16;
  685.     END;
  686.  
  687.     SetHistoryParamPtr = ^SetHistoryParam;
  688.     SetHistoryParam = RECORD
  689.         qLink:                    QElemPtr;                                { queue link in header }
  690.         qType:                    SInt16;                                    { type byte for safety check }
  691.         ioTrap:                    SInt16;                                    { FS: the Trap }
  692.         ioCmdAddr:                Ptr;                                    { FS: address to dispatch to }
  693.         ioCompletion:            SCCompletionUPP;                        { completion routine addr (0 for synch calls) }
  694.         ioResult:                OSErr;                                    { result code }
  695.         reserved:                SInt32;
  696.         reserved2:                SInt16;
  697.         historySampleTime:        SInt16;
  698.         scCode:                    SInt16;
  699.     END;
  700.  
  701.     HistoryDataPtr = ^HistoryData;
  702.     HistoryData = RECORD
  703.         dpMin:                    SInt8;
  704.         dpMax:                    SInt8;
  705.         dpAverage:                SInt8;
  706.         filler:                    SInt8;
  707.     END;
  708.  
  709.     ServerHistoryRecPtr = ^ServerHistoryRec;
  710.     ServerHistoryRec = RECORD
  711.         historySyncCount:        UInt32;
  712.         historyLastSample:        UInt32;
  713.         historySampleTime:        UInt16;
  714.         numDataPoints:            UInt16;
  715.         dataPoint:                ARRAY [0..1023] OF HistoryData;
  716.     END;
  717.  
  718.     ServerHistoryPtr                    = ^ServerHistoryRec;
  719.     GetHistoryParamPtr = ^GetHistoryParam;
  720.     GetHistoryParam = RECORD
  721.         qLink:                    QElemPtr;                                { queue link in header }
  722.         qType:                    SInt16;                                    { type byte for safety check }
  723.         ioTrap:                    SInt16;                                    { FS: the Trap }
  724.         ioCmdAddr:                Ptr;                                    { FS: address to dispatch to }
  725.         ioCompletion:            SCCompletionUPP;                        { completion routine addr (0 for synch calls) }
  726.         ioResult:                OSErr;                                    { result code }
  727.         scHistory:                ServerHistoryPtr;
  728.         numDataPointsRequested:    SInt16;
  729.         reserved2:                SInt16;
  730.         scCode:                    SInt16;
  731.     END;
  732.  
  733.     SCParamBlockRecPtr = ^SCParamBlockRec;
  734.     SCParamBlockRec = RECORD
  735.         CASE INTEGER OF
  736.         0: (
  737.             startParam:            StartParam;
  738.             );
  739.         1: (
  740.             disconnectParam:    DisconnectParam;
  741.             );
  742.         2: (
  743.             pollServerParam:    PollServerParam;
  744.             );
  745.         3: (
  746.             standardParam:        StandardParam;
  747.             );
  748.         4: (
  749.             setupParam:            SetupParam;
  750.             );
  751.         5: (
  752.             statusParam:        StatusParam;
  753.             );
  754.         6: (
  755.             serverEventParam:    ServerEventParam;
  756.             );
  757.         7: (
  758.             versionParam:        VersionParam;
  759.             );
  760.         8: (
  761.             userInfoParam:        UserInfoParam;
  762.             );
  763.         9: (
  764.             volMountedParam:    VolMountedParam;
  765.             );
  766.         10: (
  767.             getCacheStatsParam:    GetCacheStatsParam;
  768.             );
  769.         11: (
  770.             resetCacheParam:    ResetCacheParam;
  771.             );
  772.         12: (
  773.             extUserInfoParam:    ExtUserInfoParam;
  774.             );
  775.         13: (
  776.             serviceStateParam:    ServiceStateParam;
  777.             );
  778.         14: (
  779.             plugInInfoParam:    PlugInInfoParam;
  780.             );
  781.         15: (
  782.             plugInMimeTypeParam: PlugInMimeTypeParam;
  783.             );
  784.         16: (
  785.             setHistoryParam:    SetHistoryParam;
  786.             );
  787.         17: (
  788.             getHistoryParam:    GetHistoryParam;
  789.             );
  790.     END;
  791.  
  792. {  68K Trap Interface ------------------------------------------------------------------------------  }
  793.  
  794. CONST
  795.     _ServerDispatch                = $A094;                        {  ##### Will move to "Traps"  }
  796.  
  797. FUNCTION ServerDispatchSync(VAR paramBlock: SCParamBlockRec): OSErr;
  798.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  799.     INLINE $205F, $7000, $A094, $3E80;
  800.     {$ENDC}
  801. {  Note: there is no ServerDispatchAsync!  }
  802. {  Gestaltage --------------------------------------------------------------------------------------  }
  803.  
  804.  
  805. CONST
  806.     gestaltASIPFSVersion        = '#!#7';                        {  Defined only from 6.0...  }
  807.  
  808. {  Server Event Detail -----------------------------------------------------------------------------  }
  809.  
  810. {
  811.    Bit names for the serverEventMask field of ServerEventQEntry; event numbers returned in
  812.    ServerEventRecord... 
  813. }
  814.     kSCStartAFPRequestEvt        = 0;                            {  also set afpCommandMask for these  }
  815.     kSCSendAFPResponseEvt        = 1;
  816.  
  817.     kSCServerControlCallEvt        = 4;                            {  also set serverControlMask for this  }
  818.  
  819.     kSCServerBusyEvt            = 2;
  820.     kSCServerShutdownEvt        = 3;
  821.     kSCShareEvt                    = 5;
  822.     kSCUnShareEvt                = 6;
  823.     kSCSetDirAccessEvt            = 7;
  824.     kSCServerNameChangeEvt        = 8;
  825.     kSCVolumePrepEvt            = 9;
  826.     kSCVolumeUnmountEvt            = 10;
  827.     kSCServerStartupEvt            = 11;
  828.     kSCSessionTornDownEvt        = 12;
  829.     kSCOutOfSequenceEvt            = 13;
  830.     kSCWksClosedSessionEvt        = 14;
  831.     kSCSessionTimedOutEvt        = 15;
  832.     kSCSrvrClosedSessionEvt        = 16;
  833.     kSCExtendedServerEvtRec        = 31;
  834.  
  835. {  Maximum size of the Buffer in the ServerEventRecord...  }
  836.     kBufferMax                    = 48;
  837.  
  838.  
  839. TYPE
  840.     IPBlockPtr = ^IPBlock;
  841.     IPBlock = RECORD
  842.         part:                    PACKED ARRAY [0..3] OF UInt8;
  843.     END;
  844.  
  845.     UserAddressPtr = ^UserAddress;
  846.     UserAddress = RECORD
  847.         CASE INTEGER OF
  848.         0: (
  849.             wholeAddress:        UInt32;
  850.             );
  851.         1: (
  852.             appleTalkAddress:    AddrBlock;
  853.             );
  854.         2: (
  855.             ipAddress:            IPBlock;
  856.             );
  857.     END;
  858.  
  859.     ServerEventRecordPtr = ^ServerEventRecord;
  860.     ServerEventRecord = RECORD
  861.         eventNumber:            SInt32;
  862.         serverTimeInSeconds:    UInt32;
  863.         result:                    SInt16;
  864.         bufferSize:                SInt16;
  865.         buffer:                    PACKED ARRAY [0..47] OF CHAR;
  866.         nameStr:                Str31;
  867.         afpCommand:                SInt16;
  868.         sessionID:                SInt32;
  869.         userID:                    SInt32;
  870.         userName:                Str31;
  871.         vRefNum:                SInt16;
  872.         dirID:                    SInt32;
  873.         addr:                    UserAddress;
  874.     END;
  875.  
  876. {  For annexVersion field; set by server to indicate version of record...  }
  877.  
  878. CONST
  879.     kServerEventAnnexVersion6    = $06000000;
  880.  
  881.  
  882. TYPE
  883.     ExtendedServerEventRecordPtr = ^ExtendedServerEventRecord;
  884.     ExtendedServerEventRecord = RECORD
  885.         eventNumber:            SInt32;
  886.         serverTimeInSeconds:    UInt32;
  887.         result:                    SInt16;
  888.         bufferSize:                SInt16;
  889.         buffer:                    PACKED ARRAY [0..47] OF CHAR;
  890.         nameStr:                Str31;
  891.         afpCommand:                SInt16;
  892.         sessionID:                SInt32;
  893.         userID:                    SInt32;
  894.         userName:                Str31;
  895.         vRefNum:                SInt16;
  896.         dirID:                    SInt32;
  897.         addr:                    UserAddress;
  898.         transportType:            FourCharCode;
  899.         annexVersion:            UInt32;
  900.     END;
  901.  
  902. {$IFC TYPED_FUNCTION_POINTERS}
  903.     ServerEventHandlerProcPtr = PROCEDURE(entry: ServerEventQEntryPtr; VAR event: ExtendedServerEventRecord);
  904. {$ELSEC}
  905.     ServerEventHandlerProcPtr = ProcPtr;
  906. {$ENDC}
  907.  
  908.     ServerEventHandlerUPP = UniversalProcPtr;
  909.     ServerEventQEntryPtr = ^ServerEventQEntry;
  910.     ServerEventQEntry = RECORD
  911.         next:                    ServerEventQEntryPtr;
  912.         queuetype:                SInt16;
  913.         callBack:                ServerEventHandlerUPP;
  914.         serverEventMask:        SInt32;
  915.         afpCommandMask:            ARRAY [0..1] OF SInt32;
  916.         serverControlMask:        SInt32;
  917.     END;
  918.  
  919.  
  920. CONST
  921.     uppServerEventHandlerProcInfo = $000003C0;
  922.  
  923. FUNCTION NewServerEventHandlerProc(userRoutine: ServerEventHandlerProcPtr): ServerEventHandlerUPP;
  924.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  925.     INLINE $2E9F;
  926.     {$ENDC}
  927. {  -------------------------------------------------------------------------------------------------  }
  928. {$ALIGN RESET}
  929. {$POP}
  930.  
  931. {$SETC UsingIncludes := AppleShareFileServerControlIncludes}
  932.  
  933. {$ENDC} {__APPLESHAREFILESERVERCONTROL__}
  934.  
  935. {$IFC NOT UsingIncludes}
  936.  END.
  937. {$ENDC}
  938.